package exec;

public class Exec01_2 {

    public static void main(String[] args) {
        //
        char[][] poetry = {
                {'《', '咏', '鹅', '》'},
                {'骆', '宾', '王'},
                {'鹅', '，', '鹅', '，', '鹅'},
                {'曲', '项', '向', '天', '歌'},
                {'白', '毛', '浮', '绿', '水'},
                {'红', '掌', '拨', '清', '波'}
        };
        int maxLength = poetry[0].length;
        for (int i = 1; i < poetry.length; i++) {
            if (poetry[i].length > maxLength) {
                maxLength = poetry[i].length;
            }
        }

        for (int i = 0; i < maxLength; i++) {
            for (int j = poetry.length - 1; j >= 0; j--) {
                char[] arr = poetry[j];
                if (i > arr.length - 1) { // 判断下标是否会越界
                    System.out.print("\t");
                } else {
                    System.out.print(arr[i] + "\t");
                }
            }
            System.out.println();
        }
    }
}
